<!--
 * @Description: 
 * @Author: 赵大壮
 * @Date: 2022-07-04 09:50:51
 * @LastEditTime: 2022-07-04 15:04:06
 * @LastEditors: 赵大壮
-->
<template>
    <div class="w-full h-full flex flex-col">
        <div class="w-full  flex flex-col">
            <div class="flex justify-between items-center">
                <el-page-header @back="$router.back()" content="基础信息管理">
                </el-page-header>
                <div class="flex">
                    <el-button type="primary" class=" bg-cmain_hover ml-w10" icon="el-icon-plus"
                        @click="dialog_add_base = true">
                        添加基本信息</el-button>
                    <el-button type="primary" icon="el-icon-notebook-2" @click="dialog_add_template = true"
                        :class="s_inves.m_template_base.list_question.length != 0 ? 'bg-cmain_hover' : ''"
                        :disabled="s_inves.m_template_base.list_question.length == 0">
                        创建模板</el-button>
                </div>
            </div>
            <el-divider class=" mb-w10"></el-divider>
        </div>
        <el-table class="w-full " :data="s_inves.list_base_info" stripe height="500"
            @selection-change="action_table_selected">
            <el-table-column type="selection" min-width="5%">
            </el-table-column>
            <el-table-column type="index" label="序号" min-width="5%">
            </el-table-column>
            <el-table-column prop="name" label="基本信息名称" min-width="20%">
            </el-table-column>
            <el-table-column prop="inputTypeStr" label="填写方式" min-width="10%">
            </el-table-column>
            <el-table-column prop="listCoverUrl" label="选项内容" min-width="50%">
                <template slot-scope="scope">
                    <el-tag class=" mr-w5" v-for="(item, index) in scope.row.contentList" :key="index" effect="plain">{{
                            item
                    }}</el-tag>
                </template>
            </el-table-column>
            <el-table-column label="操作" min-width="10%">
                <template slot-scope="scope">
                    <el-button size="mini" style="background-color:#F56C6C" type="danger"
                        @click="action_del_base(scope.row.id)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <UiDialogAddBase :is_showDialog="dialog_add_base" type="1" @nydialog_closed="dialog_add_base = false"
            @nydialog_submit="action_add_base">
        </UiDialogAddBase>
        <UiDialogAddTemplate :is_showDialog="dialog_add_template" @nydialog_closed="dialog_add_template = false"
            @nydialog_submit="action_add_template">
        </UiDialogAddTemplate>
    </div>
</template>

<script src="./Index.ts"></script>
<style src="./Index.less" lang="less" scoped>
</style>
